<!DOCTYPE html>
<html lang="en"xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台</title>
    <script th:src="@{/statics/未压缩版.js}" type="text/javascript"></script>
    <script th:src="@{/statics/js/index.js}" type="text/javascript"></script>

    <link th:href="@{/statics/layui-v2.7.6/layui/css/layui.css}" type="text/css" rel="stylesheet">
    <script th:src="@{/statics/layui-v2.7.6/layui/layui.js}" type="text/javascript"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black"><img src=/statics/images/login/top_logo.gif style="width: 200px;height: 50px"></div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">nav groups</a>
                <dl class="layui-nav-child">
                    <dd><a href="">menu 11</a></dd>
                    <dd><a href="">menu 22</a></dd>
                    <dd><a href="">menu 33</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-hide-xs" style="margin-left: 100px"><a href="http://localhost:8080/user/loginOut">退出系统</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right" style="width: 200px;height: 100px">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block" >
                <div>欢迎登录 <span th:text="${#session.getAttribute('user').username}"></span></div>
            </li>

            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>

    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/user/limit"  target="_top" >用户查询</a></dd>
                        <dd class="main_left"><a data-src="/user/toAdd" target="_top">添加用户</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">部门管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/dept/limit"  target="_top" >部门查询</a></dd>
                        <dd class="main_left"><a  data-src="/dept/toAdd"  target="_top" >添加部门</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">职位管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/job/limit"  target="_top" >职位查询</a></dd>
                        <dd class="main_left"><a  data-src="/job/toAdd"  target="_top" >添加职位</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">员工管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/employee/limit"  target="_top" >员工查询</a></dd>
                        <dd class="main_left"><a  data-src="/employee/toAdd"  target="_top" >添加员工</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">公告管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/notice/limit"  target="_top" >公告查询</a></dd>
                        <dd class="main_left"><a  data-src="/notice/toAdd"  target="_top" >添加公告</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">下载中心</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a  data-src="/dept/limit"  target="_top" >文档查询</a></dd>
                        <dd class="main_left"><a  data-src="/dept/toAdd"  target="_top" >上传文档</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div class="main_right">
            <iframe frameborder="0" scrolling="yes" style="width: 100%" src="/user/sy" id="aa">
            </iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        底部固定区域
    </div>
</div>

<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
            }
        });

    });

    $(function(){
        //获取src值
        $(".main_left a").on("click",function(){
            var address =$(this).attr("data-src");
            $("iframe").attr("src",address);
        });
        //一下代码是根据窗口高度在设置iframe的高度
        var frame = $("#aa");

        var frameheight = $(window).height();
        console.log(frameheight);
        frame.css("height",frameheight);


    });

</script>
</body>
</html>